<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .btn{
            background-color: blue;
        }
        .btn:hover{
            background-color: red;
        }
        .btns{
            background-color: pink;
        }
        .btn2{
            background-color: yellow;
        }
    </style>
</head>
<body>
    <!-- 设计按钮 点击 hover 设计背景颜色 disable -->
    <button class="btn" >点击</button>
    <button class="btn2"  value="disable" >点击</button>
    <script>
        let btn=document.querySelector('.btn');
        btn.onclick=function(){
            btn.className="btns";
        }
        btn2.onclick=function(){
            alert("disable")
        }
    </script>
</body>
</html>